<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the time zone for some country and region code combo</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.geoip-region-name-by-code.html">geoip_region_name_by_code</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.fann.html">FANN</a></div>
 <div class="up"><a href="ref.geoip.html">GeoIP 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.geoip-time-zone-by-country-and-region" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">geoip_time_zone_by_country_and_region</h1>
  <p class="verinfo">(PECL geoip &gt;= 1.0.4)</p><p class="refpurpose"><span class="refname">geoip_time_zone_by_country_and_region</span> &mdash; <span class="dc-title">Returns the time zone for some country and region code combo</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.geoip-time-zone-by-country-and-region-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>geoip_time_zone_by_country_and_region</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$country_code</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$region_code</code></span>
  ] )</div>


  <p class="para rdfs-comment">
   The <span class="function"><strong>geoip_time_zone_by_country_and_region()</strong></span> function will return the
   time zone corresponding to a country and region code combo.
  </p>
  <p class="para">
   In the United States, the region code corresponds to the two-letter abbreviation
   of each state. In Canada, the region code corresponds to the two-letter province or
   territory code as attributed by Canada Post.
  </p>
  <p class="para">
   For the rest of the world, GeoIP uses FIPS 10-4 codes to represent regions.
   You can check <a href="http://www.maxmind.com/app/fips10_4" class="link external">&raquo;&nbsp;http://www.maxmind.com/app/fips10_4</a>
   for a detailed list of FIPS 10-4 codes.
  </p>
  <p class="para">
   This function is always available if using GeoIP Library version 1.4.1 or newer. The
   data is taken directly from the GeoIP Library and not from any database.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.geoip-time-zone-by-country-and-region-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">country_code</code></em></dt>

     <dd>

      <p class="para">
       The two-letter country code (see
       <span class="function"><a href="function.geoip-country-code-by-name.html" class="function">geoip_country_code_by_name()</a></span>)
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">region_code</code></em></dt>

     <dd>

      <p class="para">
       The two-letter (or digit) region code (see 
       <span class="function"><a href="function.geoip-region-by-name.html" class="function">geoip_region_by_name()</a></span>)
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.geoip-time-zone-by-country-and-region-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the time zone on success, or <strong><code>FALSE</code></strong> if the country and region code
   combo cannot be found.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.geoip-time-zone-by-country-and-region-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3652">
    <p><strong>Example #1 A <span class="function"><strong>geoip_time_zone_by_country_and_region()</strong></span> example using region code for US/Canada</strong></p>
    <div class="example-contents"><p>
     This will print the time zone for country CA (Canada), region QC (Quebec).
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$timezone&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">geoip_time_zone_by_country_and_region</span><span style="color: #007700">(</span><span style="color: #DD0000">'CA'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'QC'</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$timezone</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Time&nbsp;zone&nbsp;for&nbsp;CA/QC&nbsp;is:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$timezone</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Time zone for CA/QC is: America/Montreal
</pre></div>
    </div>
   </div>
   <div class="example" id="example-3653">
    <p><strong>Example #2 A <span class="function"><strong>geoip_time_zone_by_country_and_region()</strong></span> example using FIPS codes</strong></p>
    <div class="example-contents"><p>
     This will print the time zone for country JP (Japan), region 01 (Aichi).
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$timezone&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">geoip_time_zone_by_country_and_region</span><span style="color: #007700">(</span><span style="color: #DD0000">'JP'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'01'</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$timezone</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Time&nbsp;zone&nbsp;for&nbsp;JP/01&nbsp;is:&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$timezone</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Time zone for JP/01 is: Asia/Tokyo
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.geoip-region-name-by-code.html">geoip_region_name_by_code</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.fann.html">FANN</a></div>
 <div class="up"><a href="ref.geoip.html">GeoIP 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
